<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
<script>
  function echo123(){
    console.log(123);
  }
</script>
<script onload="echo123()" src="./a.js" async></script>
<!--↕一样-->
<!--<script onload="echo123()" src="./defer.js" defer></script>-->
<script>
  console.log('同步脚本 执行')
</script>
<!--
同步脚本 执行
异步脚本请求回来并正在执行
123 ← 异步脚本的同步代码执行完毕后会执行异步脚本的onload事件
异步脚本请求回的脚本发出的异步任务执行完了
-->
</body>
</html>
